package com.demo.starter.web;

import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloController {
	
	private final static Logger LOGGER = LoggerFactory.getLogger(HelloController.class);
	
    private String message = "Hello World";

    @RequestMapping("/hello")
    public ModelAndView welcome(ModelMap model) {
        model.put("time", new Date());
        model.put("message", this.message);
        return new ModelAndView("hello");
    }
    
    @RequestMapping("/exception")
    public ModelAndView exception(ModelMap model) {
        int error = 1/0;
        return new ModelAndView("user");
    }

}
